﻿using System;
using System.Collections.Generic;
using System.Linq;
using DTO;
using DAO;

namespace BUS
{
    public class TinRaoVatBUS
    {
        public static List<TinRaoVatDTO> getAlongCode(int maDanhMucCon)
        {
            return TinRaoVatDAO.getAlongCode(maDanhMucCon);
        }

        public static List<TinRaoVatDTO> getAll()
        {
            return TinRaoVatDAO.getAll();
        }

        public static TinRaoVatDTO LayTinRaoVatTheoTen_NoiDung_ThoiGianDang(string ten, string noidung, DateTime thoigiandang)
        {
            return TinRaoVatDAO.LayTinRaoVatTheoTen_NoiDung_ThoiGianDang(ten, noidung, thoigiandang);
        }

        public static void Insert(TinRaoVatDTO _insert)
        {
            TinRaoVatDAO.Insert(_insert);
        }

        public static bool Delete(int maRaoVat)
        {
            return TinRaoVatDAO.Delete(maRaoVat);
        }

        public static bool Update(TinRaoVatDTO _trv)
        {
            return TinRaoVatDAO.Update(_trv);
        }

        public static TinRaoVatDTO getAlongCode_MaTinRaoVat(int maTin)
        {
            return TinRaoVatDAO.getAlongCode_MaTinRaoVat(maTin);
        }

        public static int getMaDanhMucCon(int maTinRaoVat)
        {
            return TinRaoVatDAO.getMaDanhMucCon(maTinRaoVat);
        }

        public static bool capNhatThoiGianUp(int maTinRaoVat, DateTime thoiGianUp)
        {
            return TinRaoVatDAO.capNhatThoiGianUp(maTinRaoVat, thoiGianUp);
        }

        public static List<TinRaoVatDTO> Search(string chuoi)
        {
            return TinRaoVatDAO.Search(chuoi);
        }

        public static List<TinRaoVatDTO> SearchNangCao(string ten, string noidung, string danhmuc, string diadiem, int giatu, int giaden, DateTime thoigiantu, DateTime thoigianden)
        {
            return TinRaoVatDAO.SearchNangCao(ten, noidung, danhmuc, diadiem, giatu, giaden, thoigiantu, thoigianden);
        }
    }
}
